var errorContainer;
var controlContainer;
function ManagementOrder(errorcontainer,controlcontainer){
    errorContainer=errorcontainer;
    controlContainer=controlcontainer;
}

ManagementOrder.prototype.updateOrder=function(orderid,status){
    var xmlhttp;
    var data="action=ORDER_UPDATE&orderid="+orderid+"&status="+
    status;
    xmlhttp=getXmlHttpObj();
    xmlhttp.open("GET",contextPath+"/OrderController?"+data,true);
    xmlhttp.send();

    xmlhttp.onreadystatechange=function(e){
        var current=e.target;
        errorContainer.innerHTML="Done".fontcolor("green");
        if (current.readyState==4 && current.status==200)
        {
            var errorXml=xmlhttp.responseXML;
            errorContainer.innerHTML="";

            if(errorXml){
                errorContainer.innerHTML=xmlhttp.responseXML.getElementsByTagName("error")[0].textContent.fontcolor("red");
            }else{
                var resString=xmlhttp.responseText;
                controlContainer.innerHTML=resString;
            }
        }
    }
}


